package demo2;

import java.util.List;

public class MovieOperate {
    private Movie[] movies;
    public MovieOperate(Movie[] movies){
        this.movies = movies;
    }
    public void searchMovieById(int idx) {
       for (int i = 0; i < movies.length; i++) {
           Movie m = movies[i];
           if (m.getId() == idx){
               System.out.println("id: " +  m.getId());
               System.out.println("name: " + m.getName());
               System.out.println("price: " + m.getPrice());
               System.out.println("evaluate: " + m.getEvaluate());
               return;
           }
       }
        System.out.println("你输入的Id" + idx + "不存在");
        
    }
}
